﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace Animation_Editor
{
    public static class Utils
    {
        public static Image CropDotnetImage(Image img, Rectangle cropRectangle)
        {
            if (cropRectangle.X + cropRectangle.Width > img.Size.Width || cropRectangle.Y + cropRectangle.Height > img.Size.Height)
                return null;
            Bitmap s = new Bitmap(img);
            Bitmap d = s.Clone(cropRectangle, s.PixelFormat);
            return d;
        }
    }
}
